interface ICacheMap<T>{
    [index:string]:T,
}

export class Cache<T>{
    _caches:ICacheMap<T> = {};
    public constructor() {
    }
    get(name:string):T{
        return this._caches[name];
    }
    set(name:string,data:T){
        if (this._caches[name]){
            throw new Error(`name:${name} already in caches!`);
        }
        this._caches[name] = data
    }
}

